#ifndef _PTCDUMP_H
#define _PTCDUMP_H

//
// This file is distributed under the MIT License. See LICENSE.md for details.
//

// Standard includes
#include <cstdint>
#include <iostream>

// Local includes
#include "ptc.h"

/// Write to a stream the string representation of the PTC instruction with the
/// specified index within the instruction list.
///
/// \param Result the output stream.
/// \param Instructions the instruction list.
/// \param Index the index of the target instruction in the instruction list.
///
/// \return EXIT_SUCCESS in case of success, EXIT_FAILURE otherwise.
int dumpInstruction(std::ostream& Result, PTCInstructionList *Instructions,
                    unsigned Index);

/// Write to a stream all the instructions in an instruction list.
///
/// \param Result the output stream.
/// \param Instructions the instruction list.
///
/// \return EXIT_SUCCESS in case of success, EXIT_FAILURE otherwise.
int dumpTranslation(std::ostream& Result, PTCInstructionList *Instructions);

/// Write to a stream the dissasembled version of the instruction at the
/// specified program counter.
///
/// \param Result the output stream
/// \param PC the program counter in the current context.
void disassembleOriginal(std::ostream& Result, uint64_t PC);

#endif // _PTCDUMP_H
